import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)


export default new Vuex.Store({
  state: {
    tenantId: '',
    token: '',
    userId: '',
    // 推荐那些索引
    // currentIndex:"",
    pictureId: "",
    MyUserName: "",
  },
  mutations: {
    getID(state, payload) {
      state.tenantId = payload
    },
    GetToken(state, payload) {
      state.token = payload
    },
    getUserId(state, payload) {
      state.userId = payload
    },
    getMyUserName(state, payload) {
      state.MyUserName = payload
    },

    // const pictureId: "http://129.204.116.243:21029/Home/GetImageAsync?sysRowId=";
    // this.$store.commit("savePictureAddress",);
    // savePictureAddress(state,payload){
    //   state.pictureId=payload
    // }
    // getCurrentIndex(state,currentIndex){
    //   state.currentIndex=currentIndex
    // }
    // addinfo(state){
    //   state.info['address'] = "无锡"
    //   Vue.set(state.info,'address','无锡');//响应式增加属性
    //   Vue.delete(state.info,'age')//响应式删除属性
    // }

  },
  actions: {


  },
  getters: {
    // add(state){
    //     return state.tenantId *2
    // },
    // addPlus(state, getters){
    //   return getters.add.length
    // }
    //getters想传参
    // addPlusFn(state){
    //   return  age => { 
    //       return 操作
    //    }
    // }
  },
  modules: {
  },
})
